export default {

  data(){
    return {
      selectedIds: [],
      selectedRows: []
    }
  },
  methods:{
    //  设置选中的id
    select(selection) {
      this.selectedIds = selection.map(e => e.id)
      this.selectedRows = selection
    },

    //  当前是否已选中数据
    checkIsSelect() {
      const isSelect = this.selectedRows.length
      if (!isSelect) {
        this.$message({
          message: '请至少选中一条数据',
          type: 'info'
        })
      }
      return !!isSelect
    },
  }

}
